package com.coinland.study.window;

import android.animation.TypeEvaluator;
import android.graphics.Point;

/**
 * 类描述:  估值器Evaluator
 * 创建人:  shenZ
 * 创建时间: 2020/5/25
 * 联系方式: 252079249@qq.com
 * 修改时间: 2020/5/25
 */
public class PointEvaluator implements TypeEvaluator {

    @Override
    public Object evaluate(float fraction, Object startValue, Object endValue) {
        Point startPoint = (Point) startValue;
        Point endPoint = (Point) endValue;

        int x = (int) (startPoint.x + fraction * (endPoint.x - startPoint.x));
        int y = (int) (startPoint.y + fraction * (endPoint.y - startPoint.y));

        return new Point(x, y);
    }
}
